#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;

const int N = 2e5 + 10, INF = 0x3f3f3f3f;

int n;
int a[N];

void solve()
{
    cin >> n;
    for (int i = 1;i <= n;i++)
        cin >> a[i];
    if ((2 * a[1] - a[2]) % (n + 1) != 0) { cout << "NO\n"; return; }
    int y = (2 * a[1] - a[2]) / (n + 1);
    int x = a[1] - n * y;
    if (y < 0 || x < 0) { cout << "NO\n"; return; }
    for (int i = 1;i <= n;i++)
        if (x * i + y * (n - i + 1) != a[i]) { cout << "NO\n"; return; }
    cout << "YES\n";
}

signed main()
{
    // ios::sync_with_stdio(0);
    // cin.tie(0);cout.tie(0);
#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
    std::istringstream in(R"()");
    std::cin.rdbuf(in.rdbuf());
#endif
    int T = 1;
    cin>> T;
    for (int i = 1;i <= T;i++) {
        solve();
    }
}